#include <bits/stdc++.h>

#define rep(i, a, b) for(int i = (a), i##end = (b); i <= i##end; i++)
#define _rep(i, a, b) for(int i = (a), i##end = (b); i >= i##end; i--)

using namespace std;

typedef long long ll;
typedef __int128 i128;
typedef pair <int, int> pii;

#include "graph.h"

const int MAXN = 205;

int tot = 2;
int e[MAXN][MAXN];

void solve() {
	int siz = NumberOfRoads();
	int nw = Color();
	rep (i, 1, siz) {
		Move(i, Color());
		if (Color() != 1) {
			e[nw - 1][Color() - 1] = e[Color() - 1][nw - 1] = 1;
			Move(LastRoad(), Color());
			continue;
		}
		Move(LastRoad(), ++tot);
		e[nw - 1][tot - 1] = e[tot - 1][nw - 1] = 1;
		Move(i, Color());
		int lst = LastRoad();
		solve();
		Move(lst, Color());
	}
}

int ans[MAXN];

void Inspect(int R) {
	memset(e, 0x3f, sizeof e);
	Move(1, 2);
	Move(LastRoad(), Color());
	solve();
	tot--;
	rep (i, 1, tot) e[i][i] = 0;
	rep (k, 1, tot) {
		rep (i, 1, tot) {
			rep (j, 1, tot) {
				e[i][j] = min(e[i][j], e[i][k] + e[k][j]);
			}
		}
	}
	rep (i, 1, tot) {
		rep (j, i + 1, tot) {
			if (e[i][j] <= R) ans[e[i][j]]++;
		}
	}
	rep (i, 1, R) Answer(i, ans[i]);
}
